package mytest.excel;

import com.alibaba.excel.EasyExcel;


import javax.validation.constraints.Max;
import java.util.*;

public class DataExcelMain {
    public static void main(String[] args) {
        String filename ="D:\\date.xlsx";
      //  EasyExcel.write(filename,DataDemo.class).sheet("学生表").doWrite(getList());
        EasyExcel.read(filename,DataDemo.class,new ExcelListener()).sheet().doRead();

    }

    public static  List<DataDemo> getList(){
        List<DataDemo> list =new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            DataDemo dataDemo =new DataDemo();
            dataDemo.setId(i);
            dataDemo.setName("lxp"+i);
            list.add(dataDemo);
        }
        return list;

    }
}
